package com.dofast.bt.bean;

/**
 * Created by Administrator on 2016/12/19 0019.
 * 购物车
 */

import com.dofast.bt.base.BaseApplication;

import org.xutils.db.annotation.Column;
import org.xutils.db.annotation.Table;
import org.xutils.ex.DbException;

import java.io.Serializable;

@Table(name = "shoppingCart")
public class ShoppingCartBean implements Serializable{
    @Column(name = "spId",isId = true, property = "NOT NULL")
    private int spId;
    @Column(name = "goodsId")
    private int goodsId;
    @Column(name = "num")
    private int num;

    private boolean isCheck;// 选择
    public  ShoppingCartBean(){

    }

    public int getSpId() {
        return spId;
    }

    public void setSpId(int spId) {
        this.spId = spId;
    }

    public int getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(int goodsId) {
        this.goodsId = goodsId;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    public boolean isCheck() {
        return isCheck;
    }

    public void setCheck(boolean check) {
        isCheck = check;
    }

    /**
     * 获取购物车里的商品信息
     * @return 商品信息
     * @throws DbException
     */
    public GoodsBean getGoods() throws DbException {
        return BaseApplication.getDbManager().findById(GoodsBean.class,this.goodsId);
    }
}
